﻿<me:PDCBase x:Class="WPFExcelReport.XSPDC"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                   Background="White"  
                    Loaded="Window_Loaded"
     >
    <me:PDCBase.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:PreisConverter  x:Key="PreisConverter"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <ucd:TextTrimmingConverter  x:Key="Trim"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <CollectionViewSource   x:Key="vwPDC" Source="{Binding Path=SetData.ICC_HRPDC}" />
        <CollectionViewSource   x:Key="vwTPDC" Source="{Binding Path=SetProd.ICC_PDC}" />
    </me:PDCBase.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
        </Grid.RowDefinitions>
        <WrapPanel Grid.Row="0"  Margin="0,0,0,0">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto">
                    </ColumnDefinition>
                    <ColumnDefinition Width="Auto">
                    </ColumnDefinition>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0"
                                    VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18"  Text="查询"></TextBlock>
                <Button Grid.Column="1" Width="20" Height="20" Margin="20,0,0,0" Click="Load_Click" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/YGRHRPDC;component/Image/Search.png" />
                    </Button.Background>
                </Button>
            </Grid>
            <Grid Visibility="Collapsed">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0"  Margin="20,0,0,0" HorizontalAlignment="Center"  FontSize="18"  Text="设备"></TextBlock>
                <TextBox Grid.Column="1"  Margin="20,0,0,0"  Name="txtKRS" CharacterCasing="Upper"  Width="40" Visibility="Collapsed" ></TextBox>
                <TextBox Grid.Column="2"  Margin="20,0,0,0"  Name="txtLFD" CharacterCasing="Upper"  Width="80"  Visibility="Collapsed" ></TextBox>
                <TextBox  Grid.Row="1" Grid.Column="1"  Name="txtQM" SelectionBrush="Green" CharacterCasing="Upper" Background="Yellow"  CaretBrush="Red" 
                                  BorderBrush="Black" FontSize="18"  Width="40" ></TextBox>
            </Grid>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0"  Margin="20,0,0,0" HorizontalAlignment="Center"  FontSize="18"  Text="月份"></TextBlock>
                <TextBox Grid.Column="1"  Margin="20,0,0,0"  Text="{Binding LMONTH}"  CharacterCasing="Upper"  Width="80"  ></TextBox>
                <TextBlock Grid.Column="2"  Margin="20,0,0,0" HorizontalAlignment="Center"  FontSize="18"  Text="日期"></TextBlock>
                <TextBox Grid.Column="3"  Margin="20,0,0,0"  Text="{Binding DATES}"  CharacterCasing="Upper"  Width="80"  ></TextBox>
                <TextBox Grid.Column="4"  Margin="20,0,0,0"   Text="{Binding DATET}" CharacterCasing="Upper"  Width="80" ></TextBox>
            </Grid>
            <WrapPanel Visibility="Collapsed">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0"  Margin="20,0,0,0" 
                                    VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18"   Text="品种"></TextBlock>
                    <TextBox Grid.Column="1"  Margin="20,0,0,0"  Name="txtART" CharacterCasing="Upper"  Width="100" Height="30"></TextBox>

                </Grid>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>
                    <Button Grid.Column="0"  Margin="20,0,0,0"  Width="20" Height="20" Click="btnFilter_Click">
                        <Button.Background>
                            <ImageBrush  ImageSource="/YGRHRPDC;component/Image/Search.png" />
                        </Button.Background>
                    </Button>
                    <Button Grid.Column="1"   Click="btnFilterClear_Click">Clear</Button>
                </Grid>

                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto">
                        </ColumnDefinition>
                        <ColumnDefinition Width="Auto">
                        </ColumnDefinition>
                        <ColumnDefinition Width="Auto">
                        </ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0"  Margin="20,0,0,0" 
                                    VerticalAlignment="Center" HorizontalAlignment="Center"   Text="来单日期"></TextBlock>
                    <ComboBox Grid.Column="1"  IsEditable="True" Name="cmbNDate" Width="100" Height="30"></ComboBox>
                </Grid>
              
            </WrapPanel>
        </WrapPanel>
        <DataGrid Grid.Row="1"
                    VerticalAlignment="Top"  
                                   AutoGenerateColumns="False"
                                   EnableRowVirtualization="False"
                                   VerticalScrollBarVisibility="Auto"
                                   HorizontalScrollBarVisibility="Auto"
                                   HeadersVisibility="Column"                 
                                   HorizontalAlignment="Stretch" 
                                   Name="dlgNOrders"
                                   ItemsSource="{Binding Source={StaticResource ResourceKey=vwPDC}}"                                 
                                   Margin="0,0,0,0"             
                                   RowDetailsVisibilityMode="Visible" 
                    >
            <DataGrid.Columns>  
                <DataGridTextColumn Binding="{Binding Path=HRITPNR}" Header="工号"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=HRVNAME}" Header="姓名"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABFAGANG}" Header="岗位"  Width="Auto" /> 
                <DataGridTextColumn Binding="{Binding Path=ARTTYPE,Converter={StaticResource ResourceKey=gb2312}}" Header="品种"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=QTY}" Header="产量合计"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=UNITPRICE}" Header="单价"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=BSALARY}" Header="原始产量工资"  Width="Auto" /> 
                <DataGridTextColumn Binding="{Binding Path=BS01}" Header="01"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=BS02}" Header="02"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=BS03}" Header="03"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=BS04}" Header="04"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=BS05}" Header="05"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=BS06}" Header="06"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=BS07}" Header="07"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=BS08}" Header="08"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=BS09}" Header="09"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=BS10}" Header="10"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=BS11}" Header="11"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=BS12}" Header="12"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=BS13}" Header="13"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=BS14}" Header="14"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=BS15}" Header="15"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=BS16}" Header="16"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=BS17}" Header="17"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=BS18}" Header="18"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=BS19}" Header="19"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=BS20}" Header="20"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=BS21}" Header="21"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=BS22}" Header="22"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=BS23}" Header="23"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=BS24}" Header="24"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=BS25}" Header="25"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=BS26}" Header="26"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=BS27}" Header="27"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=BS28}" Header="28"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=BS29}" Header="29"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=BS30}" Header="30"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=BS31}" Header="31"  Width="Auto" />
            </DataGrid.Columns>
        </DataGrid  >
        <Grid Grid.Row="2">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="1*"></RowDefinition>
            </Grid.RowDefinitions>
            <WrapPanel Grid.Row="0">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto">
                        </ColumnDefinition>
                        <ColumnDefinition Width="54">
                        </ColumnDefinition>
                        <ColumnDefinition Width="6"/>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0"  Margin="20,12,0,12" 
                                    VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="12"   Text="明细"></TextBlock>
                    <Button Grid.Column="1"  Margin="20,0,0,0"  Width="20" Height="20" Click="ShowDetail_Click" Grid.ColumnSpan="2" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/YGRHRPDC;component/Image/Find.png" />
                        </Button.Background>
                    </Button>
                </Grid>
                <Button FontSize="12" Height="20" Width="20" Margin="5,0,0,0"  Click="btnPrint_Click">
                    <Button.Background>
                        <ImageBrush  ImageSource="/YGRHRPDC;component/Image/Print.png" />
                    </Button.Background>
                </Button>
                <TextBlock Margin="5,0,0,0"  Text="打印" VerticalAlignment="Center" ></TextBlock>
            </WrapPanel>
            <DataGrid  Grid.Row="1"   VerticalAlignment="Top"  
                                   AutoGenerateColumns="False"
                                   EnableRowVirtualization="False"
                                   VerticalScrollBarVisibility="Auto"
                                   HorizontalScrollBarVisibility="Auto"
                                   HeadersVisibility="Column"  
                       Name="dlgPDC"
                                   ItemsSource="{Binding Source={StaticResource ResourceKey=vwTPDC}}"    
                                   RowDetailsVisibilityMode="Visible"
                    >
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding Path=ID}" Header="ID"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=PROCESSED}" Header="P"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=ABFAUFKRS}" Header=""  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=ABFAUFLFD}" Header="生产单"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=ABFAUFPOS}" Header=""  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=ABFAFOLGE}" Header="步骤号"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=ABFAGANG}" Header="加工"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=ABFBZAGANG, Converter={StaticResource ResourceKey=Trim}}" Header="加工"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=PDCDATE}" Header="操做日期"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=PDCTIME}" Header="时间"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=PDCSTAFF}" Header="挡车工"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=PDCSHIFT}" Header="班次"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=QTY}" Header="数量"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=JP01}" Header="支数"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=JP02}" Header="锭数"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=JP03}" Header="读数"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=JP04}" Header="上次"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=JP05}" Header="最大"  Width="Auto" />
                </DataGrid.Columns>
            </DataGrid  >
        </Grid>
    </Grid>
</me:PDCBase>